package com.qiyi.player.wonder.plugins.share.view.parts
{
   import flash.display.Sprite;
   import com.qiyi.player.core.player.IPlayer;
   import flash.utils.Timer;
   import flash.text.TextField;
   import com.iqiyi.components.videoshare.ShareBg;
   import common.CommonCloseBtn;
   import com.iqiyi.components.videoshare.ShareVideoBackGround;
   import com.iqiyi.components.videoshare.SharePlayerBtn;
   import com.iqiyi.components.videoshare.SharePauseBtn;
   import com.iqiyi.components.videoshare.ShareUnfoldSprite;
   import com.iqiyi.components.videoshare.SharePackUpSprite;
   import com.qiyi.player.base.pub.EnumItem;
   import com.qiyi.player.core.model.def.ChannelEnum;
   import com.qiyi.player.core.model.def.PlayerTypeEnum;
   import flash.text.TextFieldAutoSize;
   import flash.text.TextFormat;
   import com.qiyi.player.base.utils.Strings;
   import com.qiyi.player.wonder.common.ui.FastCreator;
   import flash.events.MouseEvent;
   import com.qiyi.player.core.player.LoadMovieParams;
   import com.qiyi.player.core.CoreManager;
   import com.qiyi.player.core.player.def.PlayerUseTypeEnum;
   import com.qiyi.player.core.player.events.PlayerEvent;
   import flash.events.TimerEvent;
   import com.qiyi.player.core.player.def.StatusEnum;
   
   public class VideoShare extends Sprite
   {
      
      public function VideoShare(param1:EnumItem, param2:Boolean, param3:Boolean, param4:int, param5:EnumItem, param6:String, param7:String, param8:String, param9:String, param10:String, param11:String, param12:int = 0, param13:int = -1) {
         super();
         this._playerType = param1;
         this._startTime = param12;
         this._endTime = param13;
         this._cutInTime = 0;
         this._totalDuration = param4;
         this._movieIsMember = param3;
         this._isBD = param2;
         if(this._endTime != -1)
         {
            this._curTotalDuration = this._endTime - this._startTime;
            this._previewStopTime = this._endTime - this._startTime;
         }
         else
         {
            this._curTotalDuration = this._totalDuration - this._startTime;
            this._previewStopTime = this._totalDuration - this._startTime;
         }
         this._videoUrl = param9;
         this._flvTitle = param10;
         this._flvSubtitle = param11;
         this._flvPic = "";
         this._channel = param5;
         this._albumId = param8;
         this._tvid = param7;
         this._vid = param6;
         this.addChildren();
         this.updateChannelView();
      }
      
      private static const TEXT_SHOT_TITLE:String = "一键分享：";
      
      private static const TEXT_CODE_TITLE:String = "复制转帖：";
      
      private static const TEXT_UNFOLD:String = "分享片段";
      
      private static const TEXT_PACKUP:String = "收起片段";
      
      private static const TEXT_PLAY:String = "预览片段";
      
      private static const TEXT_PAUSE:String = "暂停";
      
      private var _model:IPlayer;
      
      private var _timer:Timer;
      
      private var _screenShotTitle:TextField;
      
      private var _embedCodesTitle:TextField;
      
      private var _videoContainer:Sprite;
      
      private var _background:ShareBg;
      
      private var _closeBtn:CommonCloseBtn;
      
      private var _videoCut:ShareVideoCut;
      
      private var _shareTimeLb:TextField;
      
      private var _videoBackground:ShareVideoBackGround;
      
      private var _shareBtnsBar:ShareBtnsBar;
      
      private var _embedCodes:ShareEmbedCodes;
      
      private var _sharePlayBtn:SharePlayerBtn;
      
      private var _sharePauseBtn:SharePauseBtn;
      
      private var _explainBtnTF:TextField;
      
      private var _shareUnfoldSprite:ShareUnfoldSprite;
      
      private var _sharePackUpSprite:SharePackUpSprite;
      
      private var _shareUnfoldOrPackupTF:TextField;
      
      private var _cutInTime:Number;
      
      private var _totalDuration:Number;
      
      private var _curTotalDuration:Number;
      
      private var _state:String;
      
      private var _startTime:int;
      
      private var _endTime:int;
      
      private var _shareStartTime:String = "0";
      
      private var _shareEndTime:String;
      
      private var _videoUrl:String;
      
      private var _flvTitle:String;
      
      private var _flvSubtitle:String;
      
      private var _flvPic:String;
      
      private var _channel:EnumItem;
      
      private var _albumId:String;
      
      private var _tvid:String;
      
      private var _vid:String;
      
      private var _channelID:int;
      
      private var _previewStopTime:Number = 0;
      
      private var _isBD:Boolean;
      
      private var _isUnfold:Boolean;
      
      private var _movieIsMember:Boolean;
      
      private var _playerType:EnumItem;
      
      private var _isPlay:Boolean = false;
      
      private function updateChannelView() : void {
         if((ChannelEnum.inShortChannel(this._channel)) || this._playerType == PlayerTypeEnum.SHARE && !this._isBD || (this._movieIsMember))
         {
            this._shareUnfoldSprite.visible = false;
            this._sharePackUpSprite.visible = false;
            this._shareUnfoldOrPackupTF.text = "";
            this._videoBackground.visible = false;
            this._videoContainer.visible = false;
            this._videoCut.visible = false;
            this._embedCodesTitle.visible = true;
            this._embedCodes.visible = true;
            this._shareTimeLb.visible = false;
            this._sharePlayBtn.visible = false;
            this._sharePauseBtn.visible = false;
            this._explainBtnTF.text = "";
            this._embedCodesTitle.x = 20;
            this._embedCodesTitle.y = 62;
            this._embedCodes.x = 22;
            this._embedCodes.y = 82;
            this._background.height = 130;
            this._embedCodes.setAlign(ShareEmbedCodes.ALIGN_H);
         }
         else
         {
            this._shareUnfoldSprite.visible = true;
            this._sharePackUpSprite.visible = false;
            this._shareUnfoldOrPackupTF.text = TEXT_UNFOLD;
            this._videoBackground.visible = false;
            this._videoContainer.visible = false;
            this._videoCut.visible = false;
            this._embedCodesTitle.visible = false;
            this._embedCodes.visible = false;
            this._shareTimeLb.visible = false;
            this._sharePlayBtn.visible = false;
            this._sharePauseBtn.visible = false;
            this._explainBtnTF.text = "";
            this._embedCodesTitle.x = 240;
            this._embedCodesTitle.y = 93;
            this._embedCodes.x = 240;
            this._embedCodes.y = 115;
            this._background.height = 100;
            this._embedCodes.setAlign(ShareEmbedCodes.ALIGN_V);
         }
      }
      
      private function addChildren() : void {
         this.addBackGround();
         this.addVideoBackGround();
         this.addShareVideo();
         this.addShareTimeLb();
         this.addSharePlayBtn();
         this.addVideoCut();
         this.addTitles();
         this.addEmbedCodes();
         this.addShareBtnsBar();
         this.addShareBackBtn();
         this.addAdvancedBtn();
         this.initListener();
         this.disableBtns();
      }
      
      private function addBackGround() : void {
         this._background = new ShareBg();
         this._background.width = 360;
         this._background.x = 0;
         this._background.y = 0;
         addChild(this._background);
      }
      
      private function addVideoBackGround() : void {
         this._videoBackground = new ShareVideoBackGround();
         this._videoBackground.x = 20;
         this._videoBackground.y = 83;
         this._videoBackground.width = 206;
         this._videoBackground.height = 116;
         addChild(this._videoBackground);
      }
      
      private function addShareVideo() : void {
         this._videoContainer = new Sprite();
         this._videoContainer.x = 20;
         this._videoContainer.y = 83;
         addChild(this._videoContainer);
      }
      
      private function addShareTimeLb() : void {
         this._shareTimeLb = new TextField();
         this._shareTimeLb.autoSize = TextFieldAutoSize.CENTER;
         this._shareTimeLb.selectable = false;
         this._shareTimeLb.x = 47;
         this._shareTimeLb.y = 60;
         var _loc1_:TextFormat = new TextFormat();
         _loc1_.font = "Arial";
         _loc1_.color = 16777215;
         _loc1_.size = 14;
         _loc1_.bold = true;
         this._shareTimeLb.defaultTextFormat = _loc1_;
         this.displayShareTimeLbTime(this._cutInTime / 1000);
         addChild(this._shareTimeLb);
      }
      
      private function displayShareTimeLbTime(param1:Number) : void {
         if(this._curTotalDuration >= 3600000)
         {
            this._shareTimeLb.text = Strings.formatAsTimeCode(param1,true);
         }
         else
         {
            this._shareTimeLb.text = Strings.formatAsTimeCode(param1,false);
         }
      }
      
      private function addSharePlayBtn() : void {
         this._sharePlayBtn = new SharePlayerBtn();
         this._sharePlayBtn.scaleX = 0.8;
         this._sharePlayBtn.scaleY = 0.8;
         this._sharePlayBtn.x = 32;
         this._sharePlayBtn.y = 135;
         this._sharePlayBtn.visible = true;
         addChild(this._sharePlayBtn);
         this._sharePauseBtn = new SharePauseBtn();
         this._sharePauseBtn.scaleX = 0.8;
         this._sharePauseBtn.scaleY = 0.8;
         this._sharePauseBtn.x = 32;
         this._sharePauseBtn.y = 135;
         this._sharePauseBtn.visible = false;
         addChild(this._sharePauseBtn);
         this._explainBtnTF = FastCreator.createLabel(TEXT_PLAY,16777215);
         this._explainBtnTF.x = this._sharePlayBtn.x + (this._sharePlayBtn.width - this._explainBtnTF.width) / 2;
         this._explainBtnTF.y = this._sharePlayBtn.y + this._sharePlayBtn.height;
         addChild(this._explainBtnTF);
      }
      
      private function addVideoCut() : void {
         this._videoCut = new ShareVideoCut(this._cutInTime,this._curTotalDuration);
         this._videoCut.x = 19;
         this._videoCut.y = 217;
         this.listenVideoCut();
         addChild(this._videoCut);
      }
      
      private function addTitles() : void {
         this._embedCodesTitle = FastCreator.createLabel(TEXT_CODE_TITLE,13421772);
         this._embedCodesTitle.x = 240;
         this._embedCodesTitle.y = 93;
         addChild(this._embedCodesTitle);
         this._screenShotTitle = FastCreator.createLabel(TEXT_SHOT_TITLE,13421772);
         this._screenShotTitle.x = 20;
         this._screenShotTitle.y = 33;
         addChild(this._screenShotTitle);
      }
      
      private function addShareBtnsBar() : void {
         this._shareBtnsBar = new ShareBtnsBar(this._flvTitle,this._flvSubtitle,this._flvPic,this._channel,this._albumId);
         this._shareBtnsBar.x = 83;
         this._shareBtnsBar.y = 32;
         addChild(this._shareBtnsBar);
      }
      
      private function addEmbedCodes() : void {
         this._embedCodes = new ShareEmbedCodes(this._videoUrl,this._totalDuration,this._startTime,this._endTime,this._flvTitle,this._flvPic,this._albumId,this._tvid,this._vid,this._movieIsMember,this._channel);
         this._embedCodes.x = 240;
         this._embedCodes.y = 115;
         addChild(this._embedCodes);
      }
      
      private function addShareBackBtn() : void {
         this._closeBtn = new CommonCloseBtn();
         this._closeBtn.x = 327;
         this._closeBtn.y = 1;
         addChild(this._closeBtn);
      }
      
      private function addAdvancedBtn() : void {
         this._shareUnfoldSprite = new ShareUnfoldSprite();
         this._shareUnfoldSprite.x = 266;
         this._shareUnfoldSprite.y = 60;
         this._shareUnfoldSprite.buttonMode = this._shareUnfoldSprite.useHandCursor = true;
         addChild(this._shareUnfoldSprite);
         this._sharePackUpSprite = new SharePackUpSprite();
         this._sharePackUpSprite.x = 266;
         this._sharePackUpSprite.y = 60;
         this._sharePackUpSprite.buttonMode = this._sharePackUpSprite.useHandCursor = true;
         addChild(this._sharePackUpSprite);
         this._shareUnfoldOrPackupTF = FastCreator.createLabel("",16777215);
         this._shareUnfoldOrPackupTF.x = 296;
         this._shareUnfoldOrPackupTF.y = 62;
         this._shareUnfoldOrPackupTF.mouseEnabled = false;
         addChild(this._shareUnfoldOrPackupTF);
      }
      
      private function initListener() : void {
         this._closeBtn.addEventListener(MouseEvent.CLICK,this.shareBackBtnHandler,false,0,true);
         this._sharePlayBtn.addEventListener(MouseEvent.CLICK,this.previewShare,false,0,true);
         this._sharePauseBtn.addEventListener(MouseEvent.CLICK,this.pausePreviewShare,false,0,true);
         this._embedCodes.addEventListener(VideoShareEvent.Evt_EmbedCodeReady,this.codeReady,false,0,true);
         this._shareUnfoldSprite.addEventListener(MouseEvent.CLICK,this.unfoldHandler,false,0,true);
         this._sharePackUpSprite.addEventListener(MouseEvent.CLICK,this.packUpHandler,false,0,true);
         this._shareBtnsBar.addEventListener(MouseEvent.CLICK,this.shareClickHandler,false,0,true);
         this._shareBtnsBar.addEventListener(VideoShareEvent.Evt_ShareLink,this.shareHandler,false,0,true);
      }
      
      private function listenVideoCut() : void {
         this._videoCut.addEventListener(VideoShareEvent.Evt_ShareChange,this.shareChangeHandler,false,0,true);
         this._videoCut.addEventListener(VideoShareEvent.Evt_ShareUpdateTime,this.shareUpdateTimeHandler,false,0,true);
         this._videoCut.addEventListener(VideoShareEvent.Evt_ShareHeadUp,this.previewHead,false,0,true);
         this._videoCut.addEventListener(VideoShareEvent.Evt_ShareTileUp,this.previewTile,false,0,true);
         this._videoCut.addEventListener(VideoShareEvent.Evt_ShareMiddleUp,this.previewMiddle,false,0,true);
      }
      
      private function stopListenVideoCut() : void {
         this._videoCut.removeEventListener(VideoShareEvent.Evt_ShareChange,this.shareChangeHandler);
         this._videoCut.removeEventListener(VideoShareEvent.Evt_ShareUpdateTime,this.shareUpdateTimeHandler);
         this._videoCut.removeEventListener(VideoShareEvent.Evt_ShareHeadUp,this.previewHead);
         this._videoCut.removeEventListener(VideoShareEvent.Evt_ShareTileUp,this.previewTile);
         this._videoCut.removeEventListener(VideoShareEvent.Evt_ShareMiddleUp,this.previewMiddle);
      }
      
      private function destroyListener() : void {
         this._closeBtn.removeEventListener(MouseEvent.CLICK,this.shareBackBtnHandler);
         this._sharePlayBtn.removeEventListener(MouseEvent.CLICK,this.previewShare);
         this._sharePauseBtn.removeEventListener(MouseEvent.CLICK,this.pausePreviewShare);
         this._embedCodes.removeEventListener(VideoShareEvent.Evt_EmbedCodeReady,this.codeReady);
         this._shareUnfoldSprite.removeEventListener(MouseEvent.CLICK,this.unfoldHandler);
         this._sharePackUpSprite.removeEventListener(MouseEvent.CLICK,this.packUpHandler);
         this._shareBtnsBar.removeEventListener(MouseEvent.CLICK,this.shareClickHandler);
         this._shareBtnsBar.removeEventListener(VideoShareEvent.Evt_ShareLink,this.shareHandler);
      }
      
      private function unfoldHandler(param1:MouseEvent) : void {
         var _loc2_:LoadMovieParams = null;
         this._shareUnfoldSprite.visible = false;
         this._sharePackUpSprite.visible = true;
         this._shareUnfoldOrPackupTF.text = TEXT_PACKUP;
         this._videoBackground.visible = true;
         this._videoContainer.visible = true;
         this._videoCut.visible = true;
         this._embedCodesTitle.visible = true;
         this._embedCodes.visible = true;
         this._shareTimeLb.visible = true;
         this._sharePlayBtn.visible = true;
         this._sharePauseBtn.visible = false;
         this._explainBtnTF.text = TEXT_PLAY;
         this._background.height = 280;
         if(!this._model)
         {
            this._isPlay = false;
            this._model = CoreManager.getInstance().createPlayer(PlayerUseTypeEnum.SHARE_SECTION);
            this._model.initialize(this._videoContainer,false,false);
            this._model.setArea(0,0,206,116);
            this._model.layer.showSubtitle = false;
            this._model.layer.showLogo = false;
            this._model.layer.showBrand = false;
            this._model.addEventListener(PlayerEvent.Evt_StatusChanged,this.onVideoStatusChanged);
            this._timer = new Timer(200);
            this._timer.addEventListener(TimerEvent.TIMER,this.onTimer);
            this.disableBtns();
            _loc2_ = new LoadMovieParams();
            _loc2_.tvid = this._tvid;
            _loc2_.vid = this._vid;
            _loc2_.startTime = this._startTime;
            _loc2_.endTime = this._endTime;
            _loc2_.movieIsMember = this._movieIsMember;
            _loc2_.recordHistory = false;
            this._model.loadMovie(_loc2_);
         }
         this._isUnfold = true;
         dispatchEvent(new VideoShareEvent(VideoShareEvent.Evt_Unfold));
      }
      
      private function onVideoStatusChanged(param1:PlayerEvent) : void {
         if(!(param1.data.isAdd as Boolean))
         {
            return;
         }
         switch(param1.data.status)
         {
            case StatusEnum.ALREADY_READY:
               this.showVideoCutPlayed();
               this.enableBtns();
               this._timer.start();
               this._isPlay = false;
               break;
            case StatusEnum.STOPED:
               this.state = "pause";
               break;
            case StatusEnum.FAILED:
               this.disableBtns();
               break;
         }
      }
      
      private function onTimer(param1:TimerEvent) : void {
         var _loc2_:* = 0;
         if(this._model.hasStatus(StatusEnum.PLAYING))
         {
            _loc2_ = this._model.currentTime - this._startTime;
            this._videoCut.updatePlayed(_loc2_);
            this.displayShareTimeLbTime(Math.floor(_loc2_ / 1000));
            if(_loc2_ >= this._previewStopTime)
            {
               if(!this._isPlay)
               {
                  this._model.play();
                  this._isPlay = true;
               }
               if(this._model.hasStatus(StatusEnum.STOPED))
               {
                  this._model.replay();
               }
               this._model.seek(this._startTime);
               this.seekPause();
            }
         }
      }
      
      private function packUpHandler(param1:MouseEvent) : void {
         this.pausePreviewShare();
         this._shareUnfoldSprite.visible = true;
         this._sharePackUpSprite.visible = false;
         this._shareUnfoldOrPackupTF.text = TEXT_UNFOLD;
         this._videoBackground.visible = false;
         this._videoContainer.visible = false;
         this._videoCut.visible = false;
         this._embedCodesTitle.visible = false;
         this._embedCodes.visible = false;
         this._shareTimeLb.visible = false;
         this._sharePlayBtn.visible = false;
         this._sharePauseBtn.visible = false;
         this._explainBtnTF.text = "";
         this._background.height = 100;
         this._isUnfold = false;
         dispatchEvent(new VideoShareEvent(VideoShareEvent.Evt_PackUp));
      }
      
      private function shareClickHandler(param1:MouseEvent) : void {
      }
      
      private function shareHandler(param1:VideoShareEvent) : void {
         var _loc2_:VideoShareEvent = new VideoShareEvent(VideoShareEvent.Evt_StartShare);
         _loc2_.shareType = param1.shareType;
         _loc2_.shareStartTime = param1.shareStartTime;
         _loc2_.shareEndTime = param1.shareEndTime;
         dispatchEvent(_loc2_);
      }
      
      private function previewShare(param1:MouseEvent) : void {
         if(this._videoCut.deselectState == "tile" || this._videoCut.deselectState == "head")
         {
            if(!this._isPlay)
            {
               this._model.play();
               this._isPlay = true;
            }
            if(this._model.hasStatus(StatusEnum.STOPED))
            {
               this._model.replay();
            }
            this._model.seek(this._videoCut.shareStartTime + this._startTime);
            this._model.resume();
         }
         else
         {
            this._model.resume();
         }
         this.showVideoCutPlayed();
         if(this._videoCut)
         {
            this._videoCut.selectHeadFlag();
         }
         this.setPlaySate();
         this.state = "play";
      }
      
      public function pausePreviewShare(param1:MouseEvent = null) : void {
         this._model.pause();
         this.state = "pause";
      }
      
      private function codeReady(param1:VideoShareEvent) : void {
         this._shareBtnsBar.flashURL = param1.flashURL;
         this._shareBtnsBar.videoURL = param1.videoURL;
      }
      
      public function get state() : String {
         return this._state;
      }
      
      public function get isUnfold() : Boolean {
         return this._isUnfold;
      }
      
      public function set state(param1:String) : void {
         this._state = param1;
         switch(this._state)
         {
            case "play":
               this.setPlaySate();
               break;
            case "pause":
               this.setPauseSate();
               break;
         }
      }
      
      private function setPlaySate() : void {
         if((this._sharePlayBtn) && (this._sharePauseBtn))
         {
            this._sharePlayBtn.visible = false;
            this._sharePauseBtn.visible = true;
            this._explainBtnTF.text = TEXT_PAUSE;
            this._explainBtnTF.x = this._sharePlayBtn.x + (this._sharePlayBtn.width - this._explainBtnTF.width) / 2;
         }
      }
      
      private function setPauseSate() : void {
         if((this._sharePlayBtn) && (this._sharePauseBtn))
         {
            this._sharePlayBtn.visible = true;
            this._sharePauseBtn.visible = false;
            this._explainBtnTF.text = TEXT_PLAY;
            this._explainBtnTF.x = this._sharePlayBtn.x + (this._sharePlayBtn.width - this._explainBtnTF.width) / 2;
         }
      }
      
      private function seekPause() : void {
         this.pausePreviewShare();
      }
      
      private function shareUpdateTimeHandler(param1:VideoShareEvent) : void {
         this.shareStartTime = Math.floor((param1.shareStartTime + this._startTime) / 1000).toString();
         this.shareEndTime = Math.floor((param1.shareStopTime + this._startTime) / 1000).toString();
         this._embedCodes.updateShareTime(this.shareStartTime,this.shareEndTime);
      }
      
      private function shareChangeHandler(param1:VideoShareEvent) : void {
         this.seekPause();
      }
      
      private function previewHead(param1:VideoShareEvent) : void {
         if(!this._isPlay)
         {
            this._model.play();
            this._isPlay = true;
         }
         if(this._model.hasStatus(StatusEnum.STOPED))
         {
            this._model.replay();
         }
         this._model.seek(param1.shareSeekTime + this._startTime);
         this.displayShareTimeLbTime(param1.shareSeekTime / 1000);
         this.seekPause();
      }
      
      private function previewTile(param1:VideoShareEvent) : void {
         if(!this._isPlay)
         {
            this._model.play();
            this._isPlay = true;
         }
         if(this._model.hasStatus(StatusEnum.STOPED))
         {
            this._model.replay();
         }
         this._model.seek(param1.shareSeekTime + this._startTime);
         this._previewStopTime = param1.shareSeekTime;
         this.displayShareTimeLbTime(param1.shareSeekTime / 1000);
         this.seekPause();
      }
      
      private function previewMiddle(param1:VideoShareEvent) : void {
         if(!this._isPlay)
         {
            this._model.play();
            this._isPlay = true;
         }
         if(this._model.hasStatus(StatusEnum.STOPED))
         {
            this._model.replay();
         }
         this._model.seek(param1.shareSeekTime + this._startTime);
         this._videoCut.deselectAll();
         this.displayShareTimeLbTime(param1.shareSeekTime / 1000);
         this.seekPause();
      }
      
      private function showVideoCutPlayed() : void {
         this._videoCut.showVideoCutPlayed();
      }
      
      private function hideVideoCutPlayed() : void {
         this._videoCut.hideVideoCutPlayed();
      }
      
      private function shareBackBtnHandler(param1:MouseEvent) : void {
         dispatchEvent(new VideoShareEvent(VideoShareEvent.Evt_Close));
      }
      
      public function get shareStartTime() : String {
         return this._shareStartTime;
      }
      
      public function set shareStartTime(param1:String) : void {
         this._shareStartTime = param1;
      }
      
      public function get shareEndTime() : String {
         return this._shareEndTime;
      }
      
      public function set shareEndTime(param1:String) : void {
         this._shareEndTime = param1;
      }
      
      private function disableBtns() : void {
         this._sharePlayBtn.mouseEnabled = false;
         this._sharePauseBtn.mouseEnabled = false;
         this._videoCut.mouseEnabled = false;
         this._videoCut.mouseChildren = false;
      }
      
      private function enableBtns() : void {
         this._sharePlayBtn.mouseEnabled = true;
         this._sharePauseBtn.mouseEnabled = true;
         this._videoCut.mouseEnabled = true;
         this._videoCut.mouseChildren = true;
      }
      
      public function getHeight() : Number {
         return this._background.height;
      }
      
      public function getWidth() : Number {
         return this._background.width;
      }
      
      public function destory() : void {
         if(this._model)
         {
            this._timer.stop();
            this._timer.removeEventListener(TimerEvent.TIMER,this.onTimer);
            this._model.removeEventListener(PlayerEvent.Evt_StatusChanged,this.onVideoStatusChanged);
            CoreManager.getInstance().deletePlayer(this._model);
            this._timer = null;
            this._model = null;
         }
         this.destroyListener();
         this.stopListenVideoCut();
         this._videoCut.destory();
         this._shareBtnsBar.destory();
      }
   }
}
